<?php
namespace Blind\Controller;
use Think\Controller;
class RouteController extends Controller {

	public function index()
	{
		$res = M('route') -> select();
		$this -> assign('data', $res);
        $this -> display();
	}

	public function doAdd()
	{
		$data = I('post.');
		$res = M('route') -> add($data);
        if($res)
        {
            $this -> success('添加成功', 'index');
        }else
        {
            $this -> error('添加失败');
        }
	}
	public function add()
	{
		$res = M('feature') -> select();
        $this -> assign('data', $res);

        $this -> display();
	}
	public function routeDel($id)
	{
		$res = M('route') -> where("id=%d",$id) -> delete();
        if($res)
        {
            $this -> success('成功');
        }else
        {
            $this -> error('失败');
        }
	}


}